﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web
{
    public partial class Site1 : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            lblTaiKhoanKH.Visible = false;
            ThoatButton.Visible = false;
            DangNhapButton.Visible = true;
            DangKyButton.Visible = true;
            if (Session["username"] != null)
            {
                lblTaiKhoanKH.Visible = true;
                ThoatButton.Visible = true;
                DangNhapButton.Visible = false;
                DangKyButton.Visible = false;
                lblTaiKhoanKH.Text = Session["username"].ToString();
            }
        }

        protected void ThoatButton_Click(object sender, EventArgs e)
        {
            Session.Remove("username");
            Response.Redirect("trang-chu.aspx");
        }

        protected void DangNhapButton_Click(object sender, EventArgs e)
        {
            Response.Redirect("dang-nhap.aspx");
        }

        protected void DangKyButton_Click(object sender, EventArgs e)
        {
            Response.Redirect("dang-ky.aspx");
        }
    }
}